<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>商品首页登录</title>
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="css/mystyle.css" rel="stylesheet" type="text/css">
</head>
<body>

<!-- 顶部banner -->
<div class="container">
    <div class="banner">
        <ul class="nav nav-pills topmenu">
            <li role="presentation"><a href="${pageContext.request.contextPath}/productServlet">主页</a></li>
            <li role="presentation"><a href="CommodityRegistered.jsp">用户注册</a></li>
            <li role="presentation"><a href="CommodityForgetPassword.jsp">忘记密码</a></li>
            <li role="presentation"><a href="${pageContext.request.contextPath}/feedbackServlet?demand=showAll">意见反馈</a></li>
        </ul>
    </div>
</div>

<!-- 导航菜单-->
<div class="container showMove">
    <div class="btn-group btn-group-justified" role="group" aria-label="...">
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-info" ><a href="${pageContext.request.contextPath}/productServlet?demand=queryKitchen&src=login" class="btn-info">厨卫专区</a></button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-info"><a href="${pageContext.request.contextPath}/productServlet?demand=queryWashing&src=login" class="btn-info">洗衣机专区</a></button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-info"><a href="${pageContext.request.contextPath}/productServlet?demand=queryComputer&src=login" class="btn-info">电脑专区</a></button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-info"><a href="${pageContext.request.contextPath}/productServlet?demand=queryTV&src=login" class="btn-info">电视机专区</a></button>
        </div>
    </div>
</div>

<!-- 新品展示区-->
<div class="container showMove">
    <div class="row">
        <div class="col-md-4">
            <div class="panel panel-info">
                <div class="panel-body text-center">
                    <table class="table table-bordered table-striped">
                        <tbody>
                        <tr>
                            <td rowspan="4"><img src="images/face/${sessionScope.loginCustomer.header}" width="100%"
                                                 alt=""/></td>
                            <td><a href="${pageContext.request.contextPath}/shoppingCartServlet?demand=show">我的购物车</a>
                            </td>
                        </tr>
                        <tr>
                            <td><a href="${pageContext.request.contextPath}/ordersServlet?demand=show&user=${sessionScope.loginCustomer.name}">我的订单</a></td>
                        </tr>
                        <tr>
                            <td><a href="${pageContext.request.contextPath}/feedbackServlet?demand=showAll">意见反馈</a></td>
                        </tr>
                        <tr>
                            <td><a href="CommodityCustomerMaterial.jsp">修改我的资料</a></td>
                        </tr>
                        <tr>
                            <td>${sessionScope.loginCustomer.name}</td>
                            <td><a href="${pageContext.request.contextPath}/productServlet">退出</a></td>
                        </tr>
                        <tr>
                            <td colspan="2">${requestScope.CookieShowTime_msg}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel panel-info">
                <div class="panel-heading">公告栏</div>
                <div class="panel-body">
                    <p>公告一：可不可以</p>
                    <p>公告一：可不可以</p>
                    <p>公告一：可不可以</p>
                    <p>公告一：可不可以</p>
                    <p>公告一：可不可以</p>
                </div>
            </div>
        </div>

        <div class="col-md-8">
            <div class="container-fluid">
                <div class="row title">
                    <h4 class="col-md-5 h4text"> 新品上架</h4>
                    <p class="text-right"><a href="${pageContext.request.contextPath}/productServlet?demand=all&src=show"> 更多>>></a></p>
                </div>
                <div class="row">
                    <c:forEach items="${sessionScope.productCommonList}" var="product">
                        <div class="col-md-3 p_info"> <img src="${product.image}" class="img-responsive">
                            <div class="p-info">
                                <p>${product.name}</p><p> ${product.price}</p>
                                <p>
                                    <a href="${pageContext.request.contextPath}/shoppingCartServlet?demand=buy&id=${product.id}" class="btn btn-info btn-sm space">购买</a>
                                    <a href="${pageContext.request.contextPath}/productServlet?demand=detail&src=detail&id=${product.id}" class="btn btn-info btn-sm">详情</a>
                                </p>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>
</div>

<!--商品搜索-->
<div class="container showMove">
    <form action="${pageContext.request.contextPath}/productServlet?demand=query&src=login" class="form-inline center formbg" method="post">
        <label class="space">商品类别</label>
        <select class="form-control space" name="type">
            <option>厨卫系列</option>
            <option>电脑专区</option>
            <option>洗衣机系列</option>
            <option>电视机系列</option>
        </select>
        <label class="space">商品名称</label>
        <input name="name" type="text" class="form-control space" id="exampleInputName2" placeholder="Jane Doe">
        <button type="submit" class="btn btn-default space">搜索</button>
    </form>
</div>


<!-- 商品打折区 -->
<div class="container showMove">
    <div class="row">
        <div class="col-md-4">
            <div class="panel panel-info">
                <div class="panel-heading">特价商品</div>
                <div class="panel-body">
                    <c:forEach items="${sessionScope.productDiscountedList}" var="product">
                        <div class="row">
                            <div class="col-md-6">
                                <img src="${product.image}" class="img-responsive"> </div>
                            <div class="col-md-6 p-info">
                                <p>${product.name}</p><p> ${product.price}</p>
                                <p>
                                    <a href="${pageContext.request.contextPath}/shoppingCartServlet?demand=buy&id=${product.id}" class="btn btn-info btn-sm space">购买</a>
                                    <a href="${pageContext.request.contextPath}/productServlet?demand=detail&src=detail&id=${product.id}" class="btn btn-info btn-sm">详情</a>
                                </p>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>


        </div>
        <div class="col-md-8">
            <div class="container-fluid">
                <div class="row title">
                    <h4 class="col-md-5 h4text"> 热销产品</h4>
                    <p class="text-right"><a href="${pageContext.request.contextPath}/productServlet?demand=all&src=show"> 更多>>></a></p>
                </div>
                <div class="row">
                    <c:forEach items="${sessionScope.productHotList}" var="product">
                        <div class="col-md-3 p_info">
                                <%--                            <img src="${product.image}" class="img-responsive img-thumbnail " onload="DrawImage(this)">--%>
                            <img src="${product.image}" class="img-responsive img-thumbnail ">
                            <div class="p-info">
                                <p>${product.name}</p><p> ${product.price}</p>
                                <p>
                                    <a href="${pageContext.request.contextPath}/shoppingCartServlet?demand=buy&id=${product.id}" class="btn btn-info btn-sm space">购买</a>
                                    <a href="${pageContext.request.contextPath}/productServlet?demand=detail&src=detail&id=${product.id}" class="btn btn-info btn-sm">详情</a>
                                </p>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="footerbg center showMove">
    <p> Designed and built with all the love in the world by @mdo and @fat. Maintained by the core team with the help of our contributors.</p>
</div>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.min.js"> </script>
</body>
</html>
